﻿using Abp.Application.Services.Dto;
using Mt.Site.Application.Organizations.Dto;
using System.Threading.Tasks;

namespace Mt.Site.Application.Organizations
{
    public interface IOrganizationUnitAppService : IBackEndAppService
    {
        Task<ListResultDto<OrganizationUnitDto>> GetOrganizationUnits();

        Task<PagedResultDto<OrganizationUnitUserListDto>> GetOrganizationUnitUsers(GetOrganizationUnitUsersInput input);
        Task<PagedResultDto<OrganizationUnitRoleListDto>> GetOrganizationUnitRoles(GetOrganizationUnitRolesInput input);
        Task<OrganizationUnitDto> CreateOrganizationUnit(CreateOrganizationUnitInput input);

        Task<OrganizationUnitDto> UpdateOrganizationUnit(UpdateOrganizationUnitInput input);

        Task<OrganizationUnitDto> MoveOrganizationUnit(MoveOrganizationUnitInput input);

        Task DeleteOrganizationUnit(EntityDto<long> input);

        Task RemoveUserFromOrganizationUnit(UserToOrganizationUnitInput input);
        
        Task RemoveRoleFromOrganizationUnit(RoleToOrganizationUnitInput input);

        Task AddUsersToOrganizationUnit(UsersToOrganizationUnitInput input);

        Task<int> AddRolesToOrganizationUnit(RolesToOrganizationUnitInput input);

        Task<PagedResultDto<NameValueDto>> FindUsers(FindOrganizationUnitUsersInput input);

        Task<bool> IsInOrganizationUnit(UserToOrganizationUnitInput input);
        Task<PagedResultDto<NameValueDto>> FindRoles(FindOrganizationUnitRolesInput input);

        Task UpSort(EntityDto<long> input);
        Task DownSort(EntityDto<long> input);
    }
}
